package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;

/**
 * 密保问题表
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "user_pwd_question")
public class UserPwdQuestion {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 用户 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    /** 问题 */
    private String question;

    /** 答案 */
    private String answer;

    /** 排序 */
    private int sort;

    /** 添加时间 */
    private Date addTime;

    /** 添加IP */
    private String addIp;

    public UserPwdQuestion() {
    }

    public UserPwdQuestion(User user) {
        this.user = user;
    }

    /**
     * 获取主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置主键
     *
     * @param id 要设置的主键
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return 用户ID
     */
    public User getUser() {
        return user;
    }

    /**
     * 设置用户ID
     *
     * @param userId 要设置的用户ID
     */
    public void setUserId(User user) {
        this.user = user;
    }

    /**
     * 获取问题
     *
     * @return 问题
     */
    public String getQuestion() {
        return question;
    }

    /**
     * 设置问题
     *
     * @param question 要设置的问题
     */
    public void setQuestion(String question) {
        this.question = question;
    }

    /**
     * 获取答案
     *
     * @return 答案
     */
    public String getAnswer() {
        return answer;
    }

    /**
     * 设置答案
     *
     * @param answer 要设置的答案
     */
    public void setAnswer(String answer) {
        this.answer = answer;
    }

    /**
     * 获取排序
     *
     * @return 排序
     */
    public int getSort() {
        return sort;
    }

    /**
     * 设置排序
     *
     * @param sort 要设置的排序
     */
    public void setSort(int sort) {
        this.sort = sort;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public void setUser(User user) {
        this.user = user;
    }

    /**
     * 获取添加IP
     *
     * @return 添加IP
     */
    public String getAddIp() {
        return addIp;
    }

    /**
     * 设置添加IP
     *
     * @param addIp 要设置的添加IP
     */
    public void setAddIp(String addIp) {
        this.addIp = addIp;
    }
}
